package com.investmenttechnologyservices.model;

import java.util.Currency;

import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Key;

public class CashInstrument extends Instrument {
	//java.util.Currency
	
	public CashInstrument(Entity entity) {
		super(entity);
	}
	
	public CashInstrument(String key, Key firmKey, String name, Key issuerKey, Currency currency,
			InstrumentType instrumentType) {
	    super(key, firmKey, name, issuerKey, instrumentType);
		setCurrency(currency);
	}

	public void setCurrency(Currency currency){
		setProperty("currency", currency.getCurrencyCode());
	}
	public Currency getCurrency() {
		String strCurrency = (String)getProperty("currency");
		return Currency.getInstance(strCurrency); 
	}
	

}
